﻿using GDPView.Services;
using Microsoft.AspNetCore.Mvc;

namespace GDPView.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class SampleDataController : ControllerBase
    {
        private readonly ISampleDataRepository _sampleDataRepository;
        public SampleDataController(ISampleDataRepository sampleDataRepository)
        {
            _sampleDataRepository = sampleDataRepository;
        }
        [HttpGet]
        public async Task<IActionResult> GetSampleDatas([FromQuery] int pageIndex, [FromQuery] int pageSize)
        {
            var SampleDatasFromRepository = await _sampleDataRepository.GetSampleDatasAsync(pageIndex, pageSize);
            return Ok(SampleDatasFromRepository);
        }
    }
}
